<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            list-style: none;
        }
    </style>
</head>
<body>
<!--Vue循环主要用到v-for -->
<ul class="list">
    <li v-for="site in sites">{{site.name}}</li>
</ul>
<!--循环取键值对,索引-->
<div id="app">
    <ul>
        <li v-for="(value, key,index) in object">
            {{index}}: {{ key }} : {{ value }}
        </li>
    </ul>
</div>
<!--for 循环取值-->
<div id="ap">
    <span v-for="n in 10">{{ n }} </span>
</div>
</body>
<script src="../lib/vue.js"></script>
<script>


    new Vue({
        el: 'ul.list',
        data: {
            sites:
                [
                    {name: 'zyd'},
                    {name: '字节跳动'},
                    {name: '阿里巴巴'},
                    {name: '小米'},
                    {name: '腾讯'},
                ]
        }
    })

    new Vue({
        el: '#app',
        data: {
            object: {
                name: 'zyd',
                age: 18,
                school: 'tust'
            }
        }
    })

    new Vue({
        el:'#app2'
    })
</script>
</html>